using System;
using System.Data;
using NHibernate;
using BEGDC.CC.Entity;
using System.Collections;

namespace BEGDC.CC.BL.CCFlow.ECS
{
	/// <summary>
	/// Summary description for ICR.
	/// </summary>
	public interface IECS : ICCFlow
	{
		#region Request
		void SaveEZApplication(Application app, CustomerInfo customer, BusinessPurpose business, Topic topic, SalesTeamInfo salesInfo, LogisticalInfo logist, PaymentInfo payment, IList customerAttendee, IList alAttendee, IList sites, IList cost, IList contract, DataTable HotelTable, DataTable CompanyCarTable, DataTable LeaseCarTable, bool isCopy, bool IsInShanghai);
		void SubmitEZApplication(Application app, CustomerInfo customer, BusinessPurpose business, Topic topic, SalesTeamInfo salesInfo, LogisticalInfo logist, PaymentInfo payment, IList customerAttendee, IList alAttendee, IList sites, IList cost,IList contract,DataTable HotelTable, DataTable CompanyCarTable, DataTable LeaseCarTable,string Comment, bool IsInShanghai);
		void SaveNormalApplication(BEGDC.CC.Entity.Application App,BEGDC.CC.Entity.CustomerInfo customer,BEGDC.CC.Entity.LogisticalInfo logistic, IList VisitingList, DataTable CustomerAttendeeTable, DataTable AccompanyTable, DataTable HotelTable, DataTable CompanyCarTable, DataTable LeaseCarTable, bool isCopy);
		void SubmitNormalApplication(BEGDC.CC.Entity.Application App,BEGDC.CC.Entity.CustomerInfo customer,BEGDC.CC.Entity.LogisticalInfo logistic, IList VisitingList, DataTable CustomerAttendeeTable, DataTable AccompanyTable, DataTable HotelTable, DataTable CompanyCarTable, DataTable LeaseCarTable,IList MemberList, string Comment);
		#endregion 

		#region AssignApplication
		void SaveNormalAssignApplication(BEGDC.CC.Entity.Application App,BEGDC.CC.Entity.CustomerInfo customer,BEGDC.CC.Entity.LogisticalInfo logistic, IList VisitingList, DataTable CustomerAttendeeTable, DataTable AccompanyTable, DataTable HotelTable, DataTable CompanyCarTable, DataTable LeaseCarTable, IList memberList);
		void SaveEZVisitAssignApplication(Application app, CustomerInfo customer, BusinessPurpose business, Topic topic, SalesTeamInfo salesInfo, LogisticalInfo logist, PaymentInfo payment, IList customerAttendee, IList alAttendee, IList sites, IList cost,IList contract,DataTable HotelTable, DataTable CompanyCarTable, DataTable LeaseCarTable, bool isCopy, bool IsInShanghai);
		void SubmitNormalAssignApplication(BEGDC.CC.Entity.Application App,BEGDC.CC.Entity.CustomerInfo customer,BEGDC.CC.Entity.LogisticalInfo logistic, IList VisitingList, DataTable CustomerAttendeeTable, DataTable AccompanyTable, DataTable HotelTable, DataTable CompanyCarTable, DataTable LeaseCarTable, string Comment, IList memberList);
		void SubmitEZVisitAssignApplication(Application app, CustomerInfo customer, BusinessPurpose business, Topic topic, SalesTeamInfo salesInfo, LogisticalInfo logist, PaymentInfo payment, IList customerAttendee, IList alAttendee, IList sites, IList cost,IList contract,DataTable HotelTable, DataTable CompanyCarTable, DataTable LeaseCarTable, bool IsInShanghai, string Comment,  IList memberList);
		void SubmitNormalAssignCheckApplication(BEGDC.CC.Entity.Application App,BEGDC.CC.Entity.CustomerInfo customer,BEGDC.CC.Entity.LogisticalInfo logistic, IList VisitingList, DataTable CustomerAttendeeTable, DataTable AccompanyTable, DataTable HotelTable, DataTable CompanyCarTable, DataTable LeaseCarTable, IList memberList,string Comment);
		void SubmitEZVisitAssignCheckApplication(BEGDC.CC.Entity.Application app, CustomerInfo customer, BusinessPurpose business, Topic topic, SalesTeamInfo salesInfo, LogisticalInfo logist, PaymentInfo payment, IList customerAttendee, IList alAttendee, IList sites, IList cost,IList contract,DataTable HotelTable, DataTable CompanyCarTable, DataTable LeaseCarTable,IList memberList, bool IsInShanghai, string Comment);
		void RejectAssignApplication(long flowID, string nextTransition, string comment);
		#endregion

		#region CheckApplication
		void SaveNormalCheckApplication(BEGDC.CC.Entity.Application App,BEGDC.CC.Entity.CustomerInfo customer,BEGDC.CC.Entity.LogisticalInfo logistic, IList VisitingList, DataTable CustomerAttendeeTable, DataTable AccompanyTable, DataTable HotelTable, DataTable CompanyCarTable, DataTable LeaseCarTable);
		void SaveEZVisitCheckApplication(Application app, CustomerInfo customer, BusinessPurpose business, Topic topic, SalesTeamInfo salesInfo, LogisticalInfo logist, PaymentInfo payment, IList customerAttendee, IList alAttendee, IList sites, IList cost,IList contract, DataTable HotelTable, DataTable CompanyCarTable, DataTable LeaseCarTable, bool isCopy, bool IsInShanghai);
		void SubmitNormalCheckApplication(BEGDC.CC.Entity.Application App,BEGDC.CC.Entity.CustomerInfo customer,BEGDC.CC.Entity.LogisticalInfo logistic, IList VisitingList, DataTable CustomerAttendeeTable, DataTable AccompanyTable, DataTable HotelTable, DataTable CompanyCarTable, DataTable LeaseCarTable, string Comment);
		void SubmitEZVisitCheckApplication(Application app, CustomerInfo customer, BusinessPurpose business, Topic topic, SalesTeamInfo salesInfo, LogisticalInfo logist, PaymentInfo payment, IList customerAttendee, IList alAttendee, IList sites, IList cost,IList contract, DataTable HotelTable, DataTable CompanyCarTable, DataTable LeaseCarTable, bool IsInShanghai, string Comment);
		void RejectCheckApplication(long flowID, string nextTransition, string comment);
		#endregion

		#region CostCenterHeadApproval
		void SubmitCostCenterHeadApproval(Application app, string Comment);
		void RejectCostCenterHeadApproval(long flowID, string nextTransition, string Comment);
		#endregion

		#region DeptHeadApproval
		void SubmitDeptHeadApproval(Application app, string Comment);
		void RejectDeptHeadApproval(long flowID, string nextTransition, string comment);
		#endregion

		#region FNCApproval
		void SubmitFNCApproval(Application app, string Comment);
		void RejectFNCApproval(long flowID, string nextTransition, string comment);
		#endregion

		#region SSMEHeadApproval
		void SubmitEVPApproval(Application app, string Comment);
		void RejectEVPApproval(long flowID, string nextTransition, string comment);
		#endregion

		#region Survey
		void SaveSurvey(Application App, BEGDC.CC.Entity.CustomerSurvey survey,IList AnswerList);
		void SubmitSurvey(Application App, BEGDC.CC.Entity.CustomerSurvey survey,IList AnswerList, string Comment);
		#endregion

		#region CloseApp
		void SaveNormalCloseApp(Application App);
		void SaveEZCloseApp(Application App);
		void SaveCloseApp(Application App, IList cost, int paymentId);
		void SubmitCloseApp(Application App, IList cost, int paymentId);
		void SubmitNormalCloseApp(Application App, string Comment);
		void SubmitEZCloseApp(Application App, bool IsInShanghai, string Comment);
		#endregion

		#region CR Tailor
		string CRTailor(long flowId,string DecisionType);
		#endregion

		#region Common Methods
		string GetCostCenterHead(string UserRole, string CodeCenterCode);
		string GetEVP();
		string GetOCORoleMemberList(string UserRole, string DepartmentCode);

		void DrawBack(long flowID, string comment);
		void Query(long flowID, string activeStep, string comment);
		void COQuery(long flowID, string activeStep, string comment);
		void ReplyQuery(long flowID, string comment);
		void COReplyQuery(long flowID, string comment);
		void SaveEntity(object obj);
		void Suspend(long flowID, string comment);
		void Resume(long flowID, string comment);
		void Archive(long flowID);
		void Callback(long flowID, string comment);
		void Cancel(long flowID, string comment);
		void ReAssign(long flowID, string employee);
		#endregion 

		#region Get Infomation
		BEGDC.CC.Entity.Application GetApplication( int AppID );
		BEGDC.CC.Entity.FlowInstance GetApplicationFlow( int AppID );
		BEGDC.CC.Entity.CustomerInfo GetCustomerInfo( int AppID );
		DataTable GetCustomerAttendeeList( int CustomerId );
		BEGDC.CC.Entity.CustomerAttendee GetCustomerAttendee( int AttendeeId );
		BEGDC.CC.Entity.ALAttendee GetAccompanyingAttendee( int AccompanyId );
		DataTable GetAccompanyingAttendeeList( int AppID );
		IList GetVisitingSites( int AppID );
		BEGDC.CC.Entity.LogisticalInfo GetLogisticalInfo( int AppID );
		IList GetVehicleTypes( string Source );
		BEGDC.CC.Entity.VehicleType GetVehicleType( int TypeId );
		IList GetHotels();
		IList GetHotelRoomTypes(int HotelId);
		//BEGDC.CC.Entity.HotelRoomType GetHotelRoomType( int TypeId );
		BEGDC.CC.Entity.HotelRoomBooking GetHotelRoomBooking( int BookingId );
		DataTable GetHotelRoomBookingList( int LogisticId );
		//BEGDC.CC.Entity.Hotel GetHotelItem(int HotelID);
		//BEGDC.CC.Entity.HotelRoomType GetRoomItem(int RoomID);
		//void UpdateHotelItem(BEGDC.CC.Entity.Hotel hotel,  bool isDel);
		//void UpdateHRoomTypeItem(BEGDC.CC.Entity.HotelRoomType Room,  bool isDel);

		BEGDC.CC.Entity.VehicleBooking GetVehicleBooking( int BookingId );
		DataTable GetVehicleBookingList( int LogisticId, string source );
		DataTable GetSurveyQuestions(string appType, string Type, bool Enable);
		BEGDC.CC.Entity.CustomerSurvey GetCustomerSurvey( int AppID );
		DataTable GetSurveyAnswer( int SurveyId );
		IList GetSurveyAnswerList( int SurveyId );
		IList GetSurveyQuestionList();
		BEGDC.CC.Entity.SurveyQuestion GetSurveyQuestion( int QuestionId );
		#endregion

		#region Dic Management
		IList GetDepartmentCode( string Dept );
		void UpdateSurveyQuestion(BEGDC.CC.Entity.SurveyQuestion Question, bool isDel);
		void UpdateVehicles(BEGDC.CC.Entity.VehicleType vehicle, bool isDel);
		#endregion

		#region Copy
		void CopyCR( int appId );
		void CopyCRApplication(Application app, CustomerInfo customer, BusinessPurpose business, Topic topic, SalesTeamInfo salesInfo, LogisticalInfo logist, PaymentInfo payment, IList customerAttendee, IList alAttendee, IList sites, IList cost, IList contract, DataTable HotelTable, DataTable CompanyCarTable, DataTable LeaseCarTable,bool isSave, bool isCopy);
		#endregion

		#region Modify
		void SaveNormalModification(Application app, DataTable CustomerAttendeeTable, DataTable AccompanyTable);
		void SaveEZModification(Application app, IList customerAttendee, IList alAttendee);
		#endregion
	}
}
